<div class="page" style="min-height: 500px;">
  <div class="page-container">
    <div class="container">
      <div class="row">
        <div class="span3">
          <h4 class="header">Groups</h4>
          <div class="sidebar">
            <ul class="col-nav span3">
              <li><a href="<?php echo base_url('groups/group_list/' . $selected_year); ?>"><i class="pull-right icon-cog"></i>Group list</a></li>
              <li><a href="<?php echo base_url('groups/group_members/' . $selected_year); ?>"><i class="pull-right icon-user"></i>Group members</a></li>
              <li style="background-color: #EEE;"><a href="<?php echo base_url('groups/group_events/' . $selected_year); ?>"><i class="pull-right icon-star"></i>Group events</a></li>
            </ul>
          </div>
        </div>
        <div class="span9">
          <div class="btn-group pull-right">
            <?php if ($this->is_comitte_member) { ?>
              <a title="<?php echo 'Can accessed by : @' . @implode(', @', $this->comitte_members); ?>" href="<?php echo base_url('groups_manage'); ?>" class="btn">Manage groups</a>
            <?php } ?>
            <button class="btn dropdown-toggle" data-toggle="dropdown"><i class="icon-calendar"></i>&nbsp;<?php echo $selected_year; ?>&nbsp;<span class="caret"></span></button>
            <ul class="dropdown-menu">
              <?php if (!empty($group_years)) { ?>
                <?php foreach ($group_years as $group_year) { ?>
                  <li>
                    <a href="<?php echo site_url('groups/group_list/' . $group_year['group_years']); ?>"><?php echo $group_year['group_years']; ?></a>
                  </li>
                <?php } ?>
              <?php } ?>
            </ul>
          </div>
          <h4 class="header">Group events : <?php echo $selected_year; ?></h4>
          <?php if (!empty($groups)) { ?>
            <?php if (!empty($group_events)) { ?>
              <?php foreach ($group_events as $group_event) { ?>
                <div class="header">
                  <i class="icon-large icon-ok-sign"></i>&nbsp;<b style="font-size: 15px;"><a style="text-decoration: none; cursor: pointer;" href="#GE<?php echo $group_event['group_event_id']; ?>" id="GE<?php echo $group_event['group_event_id']; ?>"><?php echo $group_event['group_event_name']; ?></a></b>
                  <p class="pull-right" style="font-size: 10px;"><?php echo date('d - M - Y', strtotime($group_event['group_event_date'])); ?></p>
                  <p class="pull-right" style="font-size: 10px;">&nbsp;&nbsp;|&nbsp;&nbsp;</p>
                  <p class="pull-right" style="font-size: 10px;">Max. score : <?php echo $group_event['group_event_max_score']; ?></p>
                </div>
                <?php if (!empty($group_event['group_event_results'])) { ?>
                  <table class="table table-striped table-bordered">
                    <thead>
                      <tr>
                        <th width="40%">Group name</th>
                        <th width="10%">Score</th>
                        <th width="50%">Info</th>
                      </tr>
                    </thead>
                    <tbody>
                      <?php foreach ($group_event['group_event_results'] as $event_result) { ?>
                        <tr>
                          <td><?php echo $event_result['group_name']; ?></td>
                          <td><?php echo $event_result['group_event_result_score']; ?></td>
                          <td><?php echo $event_result['group_event_result_info']; ?></td>
                        </tr>
                      <?php } ?>
                    </tbody>
                  </table>
                <?php } else { ?>
                  <div class="alert">Event results of '<?php echo strtolower($group_event['group_event_name']); ?>' not yet published !</div>
                <?php } ?>
              <?php } ?>
            <?php } else { ?>
              <div class="alert alert-danger">No group events !</div>
            <?php } ?>
          <?php } else { ?>
            <div class="alert alert-danger">No groups !</div>
          <?php } ?>
        </div>
      </div>
    </div>
  </div>
</div>

